const http = require("http");
const url = require("url");
const fs = require("fs");

let server=http.createServer((req,res)=>{
let urlObj=url.parse(req.url,true)

console.log(str)
let pathname=urlObj.pathname
if(pathname=='/'){
    // 加载form表单
    let data =fs.readFileSync('./views/index.html')

    res.write(data)
    res.end()
}else if(pathname=='/get'){
//get 请求过来的内容

res.write('Hello')
res.end()
}
})
server.listen(8989)
